/**
 * 获取目标cookie
 * @param key
 * @returns 目标cookie
 */
export const getTargetCookie = (key: string) => {
  let targetCookie = ''
  const allCookies = document.cookie
  const cookieArray = allCookies.split(';')

  cookieArray.forEach((cookie) => {
    const cookieName = cookie.split('=')[0].trim()
    if (cookieName === key) {
      targetCookie = cookie.split('=')[1]
    }
  })

  return targetCookie
}
